<template>
    <el-menu
    default-active="1"
    class="el-menu-demo"
    mode="horizontal"
    active-text-color="#ffd04b"
    @select="handleSelect"
  >
    <el-menu-item index="1" >首页</el-menu-item>
    <el-menu-item index="2">全部商品</el-menu-item>
  </el-menu>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
import { useRouter } from 'vue-router';
const router = useRouter()

const handleSelect =(index)=>{
   if(index == 1){
    router.push('mainpage')
   }else if(index == 2){
    router.push('allproductpage')
   }
}
</script>